<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="贾文清">
    <title></title>
    <style>
        main {
            width: 300px;
            margin: 0 auto;
        }

        .box {
            width: 300px;
            margin: 0 auto;
            display: flex;
        }

        div {
            width: 150px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            border: 1px solid lightgray;
            position: relative;
        }

        ul {
            margin: 0;
            padding: 0;
            list-style: none;
            position: absolute;
            left: -2px;
        }
        a{
            text-decoration: none;
            color: black;
        }

        ul li {
            width: 150px;
            height: 40px;
            line-height: 40px;
            border: 1px solid lightgray;
        }

        section {
            width: 100px;
            height: 40px;
            line-height: 40px;
            margin: 0 auto;
            position: relative;
            text-align: center;
            top:200px;
        }
        .first-box,
        .second-box{
              display: none;  
        }
        ul li:hover{
            background-color: lightgray;
        }
    </style>
</head>

<body>
    <main>
        <div class="box">
            <div class="first">
                <a href="#">销售订单</a>
                <ul class="first-box">
                    <li><a href="#">订单1</a></li>
                    <li><a href="#">订单2</a></li>
                    <li><a href="#">订单3</a></li>
                </ul>
            </div>
            <div class="second">
                <a href="#">消费订单</a>
                <ul class="second-box">
                    <li><a href="#">消费1</a></li>
                    <li><a href="#">消费2</a></li>
                    <li><a href="#">消费3</a></li>
                </ul>
            </div>
        </div>
        <section>
            00
        </section>
    </main>
    <script src="./jquery.js"></script>
</body>

</html>
<script>
    $('.first').click(function(){
        $('.first-box').show();
        $('.first-box>li').click(function(ev){
             //  阻止触发的目标元素继续冒泡
            ev.stopPropagation();
            var li = $(this).text();
            $('section').text(li);
            $('.first-box').hide();
        });
    });
    $('.second').click(function(){
        $('.second-box').show();
        $('.second-box>li').click(function(ev){
             //  阻止触发的目标元素继续冒泡
            ev.stopPropagation();
            var li = $(this).text();
            $('section').text(li);
            $('.second-box').hide();
        });
    });
</script>